import {EXCHANGERATELIST,EXCHANGERATEUPDATE,EXCHANGERATEDELETE} from '@/services/api'
import {request, METHOD} from '@/utils/request'

/**
 * 获取汇率列表
 * @param name
 * @param password
 * @returns {Promise<*>}
 */
export async function getExrateList(pageIndex, pageSize, params) {
    params.pageIndex = pageIndex
    params.pageSize = pageSize
    return request(EXCHANGERATELIST, METHOD.POST, params)
}

/**
 * 保存汇率信息
 * @param params
 * @returns {Promise<*>}
 */
export async function updateExrate(params) {
    return request(EXCHANGERATEUPDATE, METHOD.POST, params)
}

/**
 * 删除汇率信息
 * @param params
 * @returns {Promise<*>}
 */
export async function deleteExrate(codeFrom, codeTo) {
    return request(EXCHANGERATEDELETE, METHOD.GET, {codeFrom: codeFrom, codeTo: codeTo})
}